<template>
  <el-dialog
    append-to-body
    :title="title"
    :visible.sync="dialogVisible"
    width="500px"
  >
    <el-form label-width="100px" style="margin-right: 10px">
      <el-form-item label="成员：" prop="userName" v-for="item in userList" :key="item.userId">
        {{ item.userName }}
      </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="onClose">取 消</el-button>
    </span>
  </el-dialog>

</template>

<script>
import {http_user} from "@/api";

export default {
  name: 'User-parent',
  data() {
    return {
      dialogVisible: false,
      ruleForm: {},
      userList: []
    }
  },
  computed: {
    title() {
      return '下级成员'
    }
  },
  methods: {
    open(item) {
      http_user.readChildren(item.userId).then(res => {
        this.userList = res.data
      })
      this.dialogVisible = true
    },
    onClose() {
      this.dialogVisible = false
    }
  }
}
</script>

<style scoped lang="scss">
</style>
